package com.hl.controller;

import com.hl.domain.Fm;
import com.hl.service.FmService;
import com.hl.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: WenYong
 * @Date: 2024/9/4 14:52
 * @Version: 1.0
 */
@RestController
@RequestMapping("/fm")
public class FmController {
    @Autowired
    private FmService fmService;



//    获取FM中所有的咨询师文件文件
    @GetMapping("/getAllFm")
    public R getAllFm()
    {
        List<Fm> allFm = fmService.getAllFm();
        if (allFm.isEmpty()) {
            return R.fail("出错了");
        }else {
            return R.success(allFm);
        }
    }
}
